package com.mengwen.backstage.mapper;

import com.mengwen.backstage.pojo.WeixinUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Update;


@Mapper
public interface WeiXinUserInfoMapper {

    @Options(useGeneratedKeys = true,keyProperty = "incrId")
    @Insert("insert into weixin_user(openid,nickname,language,city,country,headimgurl,subscribe_time,sex,province)" +
            " values(#{openid},#{nickname},#{language},#{city},#{country},#{headimgurl},#{subscribe_time},#{sex},#{province})")
    public int addWeixinUser(WeixinUser weixinUser);


    @Update("DELETE FROM weixin_user WHERE openid = #{openid}")
    public int deleteByOpenid(String openid);





}
